package com.cc.pojo.tablestruct;

import com.cc.pojo.dto.ParametersDto;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author c.c
 */
@NoArgsConstructor
@Data
public class NeedQueryParams {

  //返回类型
  private String propertyName;
  //形参
  private String formalParameter;

  private String remark;


  public NeedQueryParams(String propertyName, String formalParameter) {
    this.propertyName = propertyName;
    this.formalParameter = formalParameter;
  }

  public NeedQueryParams(String propertyName, String formalParameter, String remark) {
    this.propertyName = propertyName;
    this.formalParameter = formalParameter;
    this.remark = remark;
  }

  public static NeedQueryParams convertNeedQueryParamsByParametersDto(ParametersDto parametersDto) {
    NeedQueryParams needQueryParams = new NeedQueryParams();
    needQueryParams.setRemark(parametersDto.getParameterName());
    needQueryParams.setPropertyName(parametersDto.getParameterType());
    needQueryParams.setFormalParameter(parametersDto.getParameter());
    return needQueryParams;
  }
}
